<?php
class ncadm extends CI_Controller{
    //put your code here

    public function  __construct() {
        parent::__construct();
        //parent::controller();
        $this->load->helper("url");
        $this->load->model('Users');
        
        $this->load->library("my_layout"); 
        $this-> my_layout->setLayout("layouts/admin/layouts.ctp"); 
    }

    // Controller mặc định cho trang chủ
    public function index(){
        
        if (!$this->session->userdata('username')) {
			redirect(base_url().'login');	
		}
		//$this->_redirect(admin_url('*/dashboard/index'));
        $this-> my_layout->view("elements/admin/content.ctp");
    }
    public function logout(){
        $this->session->sess_destroy();
        redirect(base_url().'login');
        }


}
?>